//
//  BrokerOfStoreCell.m
//  WGFGlobalHouses
//
//  Created by waiguofang on 15/6/3.
//  Copyright (c) 2015年 waiguofang. All rights reserved.
//

#import "BrokerOfStoreCell.h"

@implementation BrokerOfStoreCell
-(void)initWithTableView:(UITableView *)tableView
{
    self.delegate = tableView;
    self.showFuntionBtn1 = YES;
    self.showFuntionBtn2 = YES;
    self.showFuntionBtn3 = YES;
    
    [self setContentHight:60];
    
    
    [self.funtionBtn1 addTarget:self action:@selector(btnOnClick:) forControlEvents:UIControlEventTouchUpInside];
    [self.funtionBtn2 addTarget:self action:@selector(btnOnClick:) forControlEvents:UIControlEventTouchUpInside];
    [self.funtionBtn3 addTarget:self action:@selector(btnOnClick:) forControlEvents:UIControlEventTouchUpInside];
    
    
    self.brokerOfStoreView = [BrokerOfStoreView createView];
    [self.brokerOfStoreView setFrame:CGRectMake(0, 0, self.contentMoveView.frame.size.width, self.contentMoveView.frame.size.height)];
    [self setSelectionStyle:UITableViewCellSelectionStyleNone];
    [self.brokerOfStoreView setUserInteractionEnabled:NO];
    
    [self.contentMoveView addSubview:self.brokerOfStoreView];
}

+(CGFloat)getHeight;
{
    return 60;
}

-(void)setModel:(BorkerCellModel *)model
{
    _model = model;
    self.brokerOfStoreView.model = model;
   [self reSetfuntionBtn2TitleWithStauts:model.status];
}

-(void)btnOnClick:(UIButton *)btn
{
    if (self.btnDelegate && [self.btnDelegate respondsToSelector:@selector(brokerOfStoreCellFunctionBtnOnClick:WithModel:)]) {
        [self.btnDelegate brokerOfStoreCellFunctionBtnOnClick:btn WithModel:self.model];
    }
}
-(void)setIsEditMode:(Boolean)isEditMode
{
    _isEditMode = isEditMode;
    
    [self cloadMenu];
    
    [self setScrollAble:!isEditMode];
    
    [self.brokerOfStoreView setIsEditMode:isEditMode];

}
@end
